# ***meta charset="UTF-8"***
# @Time: 2021/2/3 15:05
# @Author: 邢光强
# @Email： 1062584918@qq.com
# @File： employee_details_page.py
# @Project: crm_project

from selenium.webdriver.common.by import By
from pages.base_page import BasePage
import xlrd

class EmployeeDetailsPage(BasePage):
    add_note_locator = (By.XPATH,"/html/body/div[5]/div[2]/div/div/div[1]/table/thead/tr/td/p/a[1]")
    add_title_locator = (By.ID,"subject")
    add_content_locator = (By.NAME,"content")
    qr_note_locatr = (By.XPATH,"/html/body/div[8]/div[2]/form/table/tbody/tr[4]/td[2]/input[1]")
    add_file_locator = (By.CLASS_NAME,"add_file")
    select_file_locator = (By.XPATH,"//*[@id='attachment1']/input")
    qr_file_locator = (By.XPATH,"/html/body/div[7]/div[2]/form/table/tbody/tr[3]/td[2]/input[1]")
    tip_locator = (By.XPATH,"/html/body/div[5]/div[2]/div/div[1]")
    ygxxbz_locator = (By.CSS_SELECTOR,"body > div.container > div.row > div > ul > li:nth-child(2) > a")
    tbody_locator = (By.XPATH,"/html/body/div[5]/div[2]/div/div[2]/div[2]/table/tbody")



    def click_add_note(self):
        self.find_element(self.add_note_locator).click()

    def input_add_title(self,title):
        self.find_element(self.add_title_locator).send_keys(title)

    def input_add_content(self,content):
        self.find_element(self.add_content_locator).send_keys(content)

    def click_qr_note(self):
        self.find_element(self.qr_note_locatr).click()

    def click_add_file(self):
        self.find_element(self.add_file_locator).click()

    def select_file(self,file):
        self.find_element(self.select_file_locator).send_keys(file)

    def click_qr_file(self):
        self.find_element(self.qr_file_locator).click()

    def tip_text(self):
        tip_element = self.find_element(self.tip_locator)
        return tip_element.text


    def click_ygxxbz(self):
        self.find_element(self.ygxxbz_locator).click()



